a = input("日期1（8位数字日期）：")
b = input("日期2（8位数字日期）：")
y = 0
m = 0
f = int(b[6:8]) - int(a[6:8])
for i in range(int(a[0:4]), int(b[0:4])):
    if i % 4 == 0:
        d = 366
        y += d
    else:
        d = 365
        y += d

if int(a[4:6]) > int(b[4:6]):
    for i in range(int(b[4:6]), int(a[4:6])):
        if i in (1,3,5,7,8,10,12):
            e = 31
            m += e
        else:
            e = 30
            m += e
if int(a[4:6]) <= int(b[4:6]):
    for i in range(int(a[4:6]), int(b[4:6])):
        if i in (1,3,5,7,8,10,12):
            e = 31
            m += e
        else:
            e = 30
            m += e
print(y, m, f)
print(y + m + f)
